import Vue from 'vue'

const API = {

    verify:(params = {})=>{
        return Vue.prototype.$http.post('/api/trial/verify',params)
            .then(res=>{
                if (res.data.total === 0) {
                    return Promise.reject(res)
                }
                return res;
            })

    },

    getTrialList:(params = {})=>{

        return Vue.prototype.$http.get('/api/trial/index',{params})
    },


    getCasesInfo:(params = {})=>{
        return Vue.prototype.$http.get('/api/trial/casesInfo',{params})
    },


    getBaoquanList: (params = {}) =>{
        return Vue.prototype.$http.get('/api/trial/baoquanList',{params})
    },


    submit: (params = {})=>{
      return Vue.prototype.$http.post('/api/trial/submit',params,{headers:{'Content-Type':'application/json'}})
    },

    upload:(forms,config)=>{

        return Vue.prototype.$http.post('/api/trial/uploadimage',forms,config)
    },

    getFileType:(params={})=>{
        return Vue.prototype.$http.get('/api/trial/filetype',params)
    },

    getImageList:(params={})=>{

        return Vue.prototype.$http.get('/api/trial/imageList',{params})
    },

    deleteImage:(params={})=>{
        return Vue.prototype.$http.get('/api/trial/deleteimage',{params})
    },
    getDb:(params={})=>{
        return Vue.prototype.$http.get('/api/trial/getDb',{params})
    }



}

export default API
